﻿@using Discussion.Web.Services.Identity
@inject Microsoft.AspNetCore.Hosting.IHostingEnvironment HostingEnvironment

@{
    string dotnetClub = "dotnetClub";
    if (null == ViewData["Title"])
    {
        ViewData["Title"] = dotnetClub;
    }
    else
    {
        string title = (string) ViewData["Title"];
        ViewData["Title"] =  $"{title} - {dotnetClub}";
    }
}
<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title>@ViewData["Title"]</title>
    <meta name="keywords" content="Keywords of the website and page" />
    <meta name="description" content="Description of the website and page" />
    <link rel="shortcut icon" href="~/favicon.ico" />
    <environment names="Development">
        <link rel="stylesheet" href="~/lib/dist/bootstrap-sass/stylesheets/bootstrap.css" />
        <link rel="stylesheet" href="~/stylesheets/css/base.css" />
    </environment>
    <environment names="QA,Integration,Staging,Production">
        <link rel="stylesheet" href="https://ajax.aspnetcdn.com/ajax/bootstrap/3.3.6/css/bootstrap.min.css"
              asp-fallback-href="~/lib/dist/bootstrap-sass/stylesheets/bootstrap.min.css"
              asp-fallback-test-class="invisible"
              asp-fallback-test-property="visibility"
              asp-fallback-test-value="hidden" />
        <link rel="stylesheet" href="~/stylesheets/css/base.min.css" asp-append-version="true" />
    </environment>
    @RenderSection("Head", required: false)
</head>
<body class="with-generic-nav">
    <nav class="navbar navbar-inverse navbar-fixed-top">
        <div class="container">
            <div class="navbar-header">
                <button type="button" class="navbar-toggle collapsed" data-toggle="collapse" data-target="#main-navigation">
                    <span class="sr-only">菜单栏</span>
                    <span class="icon-bar"></span>
                    <span class="icon-bar"></span>
                    <span class="icon-bar"></span>
                </button>
                <a class="navbar-brand" href="/">dotnetClub</a>
            </div>
            <div id="main-navigation" class="navbar-collapse collapse">
                <ul class="nav navbar-nav">
                    <li class="active"><a href="/">首页</a></li>
                    <li><a href="/about">关于</a></li>
                </ul>
                <div class="header-user pull-right">
                    @if (Context.IsAuthenticated())
                    {
                        <span class="username">欢迎你，@Context.User.Identity.Name</span>
                        <form class="signout-form" action="@Url.Action("DoSignOut", "Account")" method="post">
                            <button>退出登录</button>
                        </form>
                    }
                    else
                    {
                       
                        @Html.ActionLink("注册", "Register", "Account", null, new {@class = "signin-link"})
                        <span>&nbsp;</span>
                        @Html.ActionLink("登录", "Signin", "Account", null, new {@class = "signin-link"})
                    }
                </div>
            </div>
        </div>
    </nav>

    @RenderSection("PreContent", required: false)

    <div class="container body-content">
        @RenderBody()        
    </div>

    @RenderSection("PostContent", required: false)

<footer class="page-footer container">
    © @DateTime.Today.Year dotnetClub
</footer>

<environment names="Development">
    <script src="~/lib/dist/jquery/jquery.js"></script>
    <script src="~/lib/dist/bootstrap-sass/javascripts/bootstrap.js"></script>
</environment>
<environment names="QA,Integration,Staging,Production">
    <script src="https://ajax.aspnetcdn.com/ajax/jquery/jquery-2.1.4.min.js"
            asp-fallback-src="~/lib/dist/jquery/jquery.min.js"
            asp-fallback-test="window.jQuery">
    </script>
    <script src="https://ajax.aspnetcdn.com/ajax/bootstrap/3.3.6/bootstrap.min.js"
            asp-fallback-src="~/lib/dist/bootstrap-sass/javascripts/bootstrap.min.js"
            asp-fallback-test="window.jQuery && window.jQuery.fn && window.jQuery.fn.modal">
    </script>
</environment>

    @RenderSection("Tail", required: false)
</body>
</html>
<!-- Environment: @HostingEnvironment.EnvironmentName -->